FIG. 1 shows a known method for generating animations. The image data 2 for each frame is generated by program running on a computer (not shown). To generate animations, the computer writes one frame of the animation to a frame buffer 4 at a time. The frame buffer 4 has sufficient memory to store only one image frame. The contents of the frame buffer 4 are transferred to a display 6 in horizontal lines 8 from the top of the image to the bottom of the image. In parallel, the computer writes the image data 2 corresponding to the next frame to the frame buffer 4 in horizontal lines 10 from the top of the image to the bottom of the image. It is necessary that the computer writes only to the portion of the frame buffer 4 from which has already been copied to the display 6.
Image tearing is a well-known problem in displaying computer-generated animations. An example of image tearing is shown in FIG. 2. Image tearing can occur when the writing of image data 2 to the frame buffer 4 overtakes the transfer from the frame buffer 4 to the display 6 or vice versa. Here, the computer therefore writes to a part of the image that has not yet been refreshed on the display 6. The display 6 then contains image data from one frame 10 at the top of the display 12, and the image data from the next frame 14 on the bottom of the display 16. When the content of the two frames 10, 14 are different, the result is a torn image, which can appear as flickering to a user.
A further problem can occur when the image stored on the frame buffer 4 is in landscape format. This is illustrated in FIG. 3. The computer writes the image data 2 corresponding to the landscape frame in horizontal lines 10 from top to bottom. However, the image frame is rotated to display it on a portrait-oriented display 6, and therefore the contents of the frame are transferred to the display 6 in vertical lines 8 from left to right. It is therefore impossible to update the frame correctly using the technique described above, as there always is overlap between two consecutive frames.
The simplest way to avoid this problem is to write a complete frame of image data 2 to the frame buffer 4, and then pause the writing of image data 2 to the frame buffer 4 while the display 6 is refreshed. This is unsatisfactory since it can slow down the frame rate considerably.
One technique used to minimise image tearing is known as ‘double buffering’. In this technique, two buffers are used, where one frame is known as the front buffer and the other frame is known as the back buffer. The back buffer is used to render a frame out of sight i.e. without it being displayed. A previously rendered, complete frame is stored in the front buffer. The contents of the front buffer are transferred to the display to be viewed by a user. When the frame on the back buffer is complete i.e. the frame is filled with image data, the front and back buffers are swapped. The next frame is then written to the new back buffer whilst data from the front buffer is transferred to the display. Only fully rendered images are presented to the user, so image tearing is eliminated. Ideally, the exchange of front and back buffers occurs instantaneously. However, in practise there is a small delay while the buffers swap. This can slow down the frame rate. The double buffering technique also requires double the amount of memory of the conventional system, and such systems can be costly to build.
Double buffering allows flexible display orientation since data is never rendered to the same frame buffer that is used to transfer data to the display, so the different reading and writing directions are unimportant.
The inventor appreciates that it would be advantageous to provide an improved method for image display while avoiding the risk of image tearing whilst not requiring parallel frame buffers.